package com.lq.createPattern.factory.before;

public class CoffeStore {
    public Coffee orderCofee(String type){
        Coffee coffee=null;
        if(type.equalsIgnoreCase("china")){
            coffee=new ChinaCoffee();
        }else if(type.equalsIgnoreCase("american")){
            coffee=new AmericanCoffee();
        } else {
            throw new RuntimeException("本店暂不支持其他品类咖啡");
        }
        coffee.addSugar();
        coffee.addMilk();
        return coffee;
    }
}
